<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateBlocksTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('blocks', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('object_id', 64)->unique('object_id_unique')->comment('objectId');
			$table->integer('group')->default(0)->comment('分组');
			$table->string('type')->index('type_index')->comment('类型');
			$table->string('template')->default('default')->comment('模板');
			$table->string('title')->comment('标题');
			$table->string('icon')->nullable()->comment('图标');
			$table->string('more_title')->nullable()->comment('更多链接名称');
			$table->string('more_link')->nullable()->comment('更多链接');
			$table->text('content', 65535)->nullable()->comment('内容');
			$table->integer('created_op')->default(0)->comment('创建人');
			$table->integer('updated_op')->default(0)->comment('更新人');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('blocks');
	}

}
